/* 主题风格
 * @Author: lixl
 * @Date: 2022-07-06 18:13:55
 * @Last Modified by: lixl
 * @Last Modified time: 2022-07-08 10:28:47
 */

import { defineStore } from "pinia";

interface AppState {
  theme: string;
  showTag: boolean;
}

export const themes = defineStore({
  id: "themes",
  state: (): AppState => ({
    theme: "dark", // 风格：light 和 dark
    showTag: true, // 是否启用tag标签栏
  }),
  getters: {
    getTheme(state): string {
      return state.theme;
    },
    getShowTag(state): boolean {
      return state.showTag;
    },
  },
  actions: {
    setTheme(theme: string): void {
      this.theme = theme;
    },
    setShowTag(showTag: boolean): void {
      this.showTag = showTag;
    },
  },
});
